#!usr/lib/perl
use 5.014;
use warnings;
use utf8;

sub greet{
	state $lastName = "";
	my ($name) = @_;
	if($lastName eq ""){
		$lastName = $name;
		print "Hi ",  $name, "! You are the first one here!\n";
		}
	else{
		print "Hi ", $name, "! ", $lastName , " is also here!\n"
		}
	}

sub greetAll{
	state $lastNames = "";
	my ($name) = @_;
	if($lastNames eq ""){
		print "Hi ",  $name, "! You are the first one here!\n";
		}
	else{
		print "Hi ", $name, "!  I've seen:  ", $lastNames , ".\n";
		}
	$lastNames .= " $name";
	}

greet( "Fred" );
greet( "Barney" );
# This sequence of statements should print:
# Hi Fred! You are the first one here!
# Hi Barney! Fred is also here!



greetAll("Fred" );
greetAll("Barney" );
greetAll("Wilma" );
greetAll("Betty" );

